home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / std / c / 308 < prev    next >
Text File  |  1996-08-06  |  3KB  |  73 lines

  1. Newsgroups: comp.std.c
  2. Path: tmai.com!usenet
  3. From: Sridhar Panchapakesan <sridharp>
  4. Subject: (no subject)
  5. X-Nntp-Posting-Host: 205.159.65.69
  6. Content-Type: multipart/mixed;
  7.     boundary="-------------------------------1458920801586317958839761223"
  8. Message-ID: <1996Feb5.225112.9993@tmai.com>
  9. Sender: usenet@tmai.com (usenet acct for news)
  10. Organization: TMA, Inc.
  11. Mime-Version: 1.0
  12. Date: Mon, 5 Feb 1996 22:51:12 GMT
  13. X-Mailer: Mozilla 1.1 (X11; U; SunOS 4.1.4 sun4m)
  14. X-Url: file: /usr0/home/sridharp/work/misc/querieUnix
  15.  
  16. This is a multi-part message in MIME format.
  17.  
  18. ---------------------------------1458920801586317958839761223
  19. Content-Transfer-Encoding: 7bit
  20. Content-Type: text/plain; charset=us-ascii
  21.  
  22. -- 
  23.  
  24. -----------------------------------------------------------------------------
  25. sridhar panchapakesan, member of technical staff
  26. e-mail: sridhar_panchapakesan@tmai.com
  27. phone : (415) 856-8862 x279     fax : (415) 856-8860
  28. technology modeling associates, inc. (http://www.tmai.com)    
  29.        __o              
  30.          _ \<,_                   
  31.         (*)/ (*) 
  32.          -----     Save Earth
  33. -----------------------------------------------------------------------------
  34.  
  35. ---------------------------------1458920801586317958839761223
  36. Content-Transfer-Encoding: 7bit
  37. Content-Type: text/plain
  38.  
  39.  
  40. I am trying to use 'getopt' to read a quoted string as options for a
  41. program. It works fine when I try it from a shell (csh) but when I try
  42. running it from a script using 'exec' it does not accept the entire the
  43. entire quoted string as the option.
  44.  
  45. e.g. ( test is the program name)
  46. % test -f "-g -o 5" in.txt
  47. ( getopt works fine. The string "-g -o 5" is read correctly into
  48. optargs. Note that I have to use '-' (dash) in the string as a
  49. requirement of the program itself.)
  50.  
  51. However when I try it from the script file:
  52.  
  53. exec test -f "\"-g -o 5\"" in.txt
  54.  
  55. The getopt only recognizes "-g as the option for -f instead of "-g -o
  56. 5".
  57.  
  58. I would appreciate any help in this area..
  59.  
  60. - Sridhar.
  61.  
  62. -----------------------------------------------------------------------------
  63. sridhar panchapakesan, member of technical staff
  64. e-mail: sridhar_panchapakesan@tmai.com
  65. phone : (415) 856-8862 x279     fax : (415) 856-8860
  66. technology modeling associates, inc. (http://www.tmai.com)    
  67.        __o              
  68.          _ \<,_                   
  69.         (*)/ (*) 
  70.          -----     Save Earth
  71. -----------------------------------------------------------------------------
  72. ---------------------------------1458920801586317958839761223--
  73.